package com.controller;

import com.Dao.BorrowCardDao;
import com.po.BorrowCard;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class BorrowCardController {

    @RequestMapping(value = "/doFind")
    public String doFindId(BorrowCard borrowCard, Model model)throws Exception {
        BorrowCardDao a = new BorrowCardDao();
        List<BorrowCard> borrowCards = a.findBorrowCardAndInfoByStudyId2(borrowCard);
        System.out.println(borrowCards);
        model.addAttribute("cs",borrowCards);
        return "/find.jsp";
    }

    @RequestMapping(value = "/doFind2")
    public String doFind(BorrowCard borrowCard, Model model)throws Exception {
        BorrowCardDao a = new BorrowCardDao();
        List<BorrowCard> borrowCards = a.findBorrowCardAndInfoByStudyId(borrowCard);
        System.out.println(borrowCards);
        model.addAttribute("cs",borrowCards);
        return "/find.jsp";
    }
}
